/*********************
* Author:Dzlua
* QQ:505544956
* time:2016/05/03
*/
#ifndef __EDUI_ITEXTURE_H__
#define __EDUI_ITEXTURE_H__

#include "../core/Base.h"

EDUI_NAMESPACE_BEGIN

class IRender;
class ISurface;

class EDUI_API ITexture
{
public:
    virtual void Release() = 0;
public:
    virtual bool Create(IRender* render, int w, int h, TextureAccess access, const char* name, int id = -1) = 0;
	// if no name,default file
	virtual bool Create(IRender* render, const char* file, const char* name = 0, int id = -1) = 0;
	// if no name,default the same as surface
	virtual bool Create(IRender* render, ISurface* surface, const char* name = 0, int id = -1) = 0;

	virtual bool IsOK() = 0;
	virtual void Destroy() = 0;

	//Texture number.
    virtual int GetNum() = 0;
    //for gif
    virtual Point GetOffset(int id) = 0;
    //for gif
    virtual int GetDelay(int id) = 0;
	
	virtual Size GetSize(int id = 0) = 0;

	virtual bool SetColorMod(Uint8 r, Uint8 g, Uint8 b, int id = 0) = 0;
	virtual Color GetColorMod(int id = 0) = 0;
	virtual bool SetAlphaMod(Uint8 alpha, int id = 0) = 0;
	virtual Uint8 GetAlphaMod(int id = 0) = 0;
	virtual bool SetBlendMode(BlendMode mode, int id = 0) = 0;
	virtual BlendMode GetBlendMode(int id = 0) = 0;

	virtual void Update(const Rect* rect, const void* pixels, int pitch, int id = 0) = 0;
	virtual void UpdateYUV(const Rect* rect,
						const Uint8 *Yplane, int Ypitch,
                        const Uint8 *Uplane, int Upitch,
                        const Uint8 *Vplane, int Vpitch, int id = 0) = 0;

	virtual bool Lock(const Rect* rect, void** pixels, int* pitch, int id = 0) = 0;
	virtual void Unlock(int id = 0) = 0;
    
};

EDUI_NAMESPACE_END

#endif